/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: WHY
 * Date: 2022-11-10
 * Time: 14:57
 */
//静态类随着类得加载而被加载，随着类的销毁而被销毁
class Animal{
    public String name;
    public int age;
    public void wash(){
        System.out.println(name+"正在洗澡");
    }

}



class   Cat  extends  Animal {
    public void xiaomi() {
        System.out.println(name + "正在喵喵叫");
    }
}

    class Dog extends Animal{
        public void xiaowang(){
            System.out.println(name+"正在汪汪叫");
        }
    }






public class TestDemo {
    public static void main(String[] args) {
        Cat cat=new Cat();
        cat.name="咪咪";
        cat.age=2;
        cat.wash();
        cat.xiaomi();
        Dog  dog=new Dog();
        dog.name="贝贝";
        dog.age=3;
        dog.xiaowang();
        dog.wash();
    }
}
